/**
 * Created by Administrator on 2018/1/12.
 */
var appMaster = {

    preLoader: function(){
        imageSources = []
        $('img').each(function() {
            var sources = $(this).attr('src');
            imageSources.push(sources);
        });
        if($(imageSources).load()){
            $('.pre-loader').fadeOut('slow');
        }
    },

    revSlider: function() {

        // var docHeight = $(window).height();


        var mainSlider = $('.tp-banner').revolution({
            delay: 9000,
            startwidth: 1170,
            startheight: 300,
            hideThumbs: 10,
            touchenabled: false,
            fullWidth: "off",
            hideTimerBar: "on",
            fullScreen: "off",
            onHoverStop: "off",
            fullScreenOffsetContainer: "",
        });

    },



}; // AppMaster


$(document).ready(function() {

    appMaster.revSlider();

    // appMaster.placeHold();

});

$(function(){
    $('.suixuntong .details').click(function(){
        $('.sxtsrc').attr('src',$(this).attr('data-sxtsrc'))
        return false;
    });
    $('.searchbutton').click(function () {
        var searchVal = $("input[type=text]").val();
        var urlParam = "/newsCenter/hotNews/";
        if (searchVal != null && searchVal != '') {
            urlParam = urlParam + '?title=' + searchVal;
        }
        $.ajax({
            type: "GET",
            url: urlParam,
            success: function (data) {
                var dataHtml = '';
                if (data != null && data.code == 200) {
                    for (var i = 0; i < data.data.length; i++) {
                        var hotNews = data.data[i];
                        dataHtml += "<li><a href='/newsCenter/getNews/" + hotNews.id + "'>" + hotNews.title + "</a></li>";
                    }
                    $("#hotNews-ul").html(dataHtml);
                }
            }
        });
    });
})